home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / src / GLperf3.12-src.lha / GLperf / Timer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-01  |  2.1 KB  |  73 lines

  1. /*
  2.  *   (C) COPYRIGHT International Business Machines Corp. 1993
  3.  *   All Rights Reserved
  4.  *   Licensed Materials - Property of IBM
  5.  *   US Government Users Restricted Rights - Use, duplication or
  6.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7.  
  8. //
  9. // Permission to use, copy, modify, and distribute this software and its
  10. // documentation for any purpose and without fee is hereby granted, provided
  11. // that the above copyright notice appear in all copies and that both that
  12. // copyright notice and this permission notice appear in supporting
  13. // documentation, and that the name of I.B.M. not be used in advertising
  14. // or publicity pertaining to distribution of the software without specific,
  15. // written prior permission. I.B.M. makes no representations about the
  16. // suitability of this software for any purpose.  It is provided "as is"
  17. // without express or implied warranty.
  18. //
  19. // I.B.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  20. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I.B.M.
  21. // BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  22. // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  23. // OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  24. // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25. //
  26. // Author:  John Spitzer, IBM AWS Graphics Systems (Austin)
  27. //
  28. */
  29.  
  30. #ifndef _Timer_h
  31. #define _Timer_h
  32.  
  33. #if defined(WIN32)
  34.  
  35. #include <windows.h>
  36. #include <time.h>
  37. typedef struct _Timer {
  38.     long buf;
  39.     DWORD start, stop;
  40.     float elapsed;
  41. } Timer, *TimerPtr;
  42.  
  43. #elif defined(__OS2__)
  44.  
  45. #define INCL_DOSMISC
  46. #include <os2.h>
  47. #include <time.h>
  48. typedef struct _Timer {
  49.     long buf;
  50.     ULONG start, stop;
  51.     float elapsed;
  52. } Timer, *TimerPtr;
  53.  
  54. #else
  55.  
  56. #include <time.h>      /* for CLK_TCK */
  57. #include <sys/times.h>
  58. typedef struct _Timer {
  59.     struct tms buf;
  60.     time_t start, stop;
  61.     float elapsed;
  62. } Timer, *TimerPtr;
  63.  
  64. #endif
  65.  
  66. TimerPtr new_Timer();
  67. void delete_Timer(TimerPtr);
  68. void Timer__Start(TimerPtr);
  69. void Timer__Stop(TimerPtr);
  70. float Timer__Read(TimerPtr);
  71.  
  72. #endif
  73.